package com.tenchael.iblog.web.controller;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;

/**
 * Created by tengzhizhang on 2017/12/24.
 */
@Controller
public class HomeController extends BaseController {
	private static final Logger LOGGER = LogManager.getLogger(HomeController.class);

	@Value("${welcome.message:test}")
	private String message = "Hello World";

	@RequestMapping(value = {"/", "/home", "/index.html"})
	public String home(Map<String, Object> model) {
		LOGGER.debug("access home@{}", System.currentTimeMillis());
		model.put("message", this.message);
		return "welcome";
	}
}
